#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
    double UF = pow(2,-1);
    double OF = pow(2,1)*(2-pow(2,1-3));
    cout << "UFL(F) = " << UF << endl;
    cout << "OFL(F) = " << OF << endl;

    vector<double> v1;
    v1.push_back(0);
    for (int i=-1; i<=1; i++){
	for (int j = 0; j<=3; j++){
	    double val = (1.0+0.25*j)*pow(2,i);
	    v1.push_back(val);
	    v1.push_back(-val);
	}
    }
    cout << "There are " << v1.size() << " numbers in F" << endl;
    sort(v1.begin(),v1.end());
    for (auto p=v1.begin(); p!=v1.end();p++){
	cout << *p << " ";
    }
    cout << endl;

    vector<double> v2;
    for (int i=1; i<=3; i++){
	double val1 = 0.25*i*pow(2,-1);
	v2.push_back(val1);
	v2.push_back(-val1);
    }
    cout << "There are " << v2.size() << " subnormal numbers in F" << endl;
    sort(v2.begin(),v2.end());
    for (auto p=v2.begin(); p!=v2.end();p++){
	cout << *p << " ";
    }
    cout << endl;

    return 0;
}